﻿using System;
using System.Xml.Serialization;
using Harvest.Api.Types;

namespace Harvest.Api.Model.Internal
{

    //<day_entry>
    //  <id type="integer">33179430</id>
    //  <spent_at type="date">2010-10-21</spent_at>
    //  <user_id type="integer">164330</user_id>
    //  <client>Monotic</client>
    //  <project_id>890444</project_id>
    //  <project>Internal</project>
    //  <task_id>658571</task_id>
    //  <task>Admin</task>
    //  <hours type="float">1.00</hours>
    //  <notes>Test</notes>
    //  <created_at type="datetime">Thu, 21 Oct 2010 13:08:53 +0000</created_at>
    //  <updated_at type="datetime">Thu, 21 Oct 2010 13:08:53 +0000</updated_at>
    //</day_entry>

    /// <summary>
    /// 
    /// </summary>
    /// <remarks>
    /// Don't change the XmlElement attributes, otherwise (de)serialization will fail.
    /// </remarks>
    [XmlRoot(ElementName = "day_entry", IsNullable = false)]
    public class DayEntryItem
    {

        /// <summary>
        /// 
        /// </summary>
        [XmlElement(ElementName = "id", IsNullable = true)]
        public NullableInt Id { get; set; }

        /// <summary>
        /// 
        /// </summary>
        [XmlElement(ElementName = "spent_at", DataType = "dateTime", IsNullable = true)]
        public DateTime? SpentAt { get; set; }

        /// <summary>
        /// 
        /// </summary>
        [XmlElement(ElementName = "user_id", IsNullable = true)]
        public NullableInt UserId { get; set; }

        /// <summary>
        /// 
        /// </summary>
        [XmlElement(ElementName = "client")]
        public string Client { get; set; }

        /// <summary>
        /// 
        /// </summary>
        [XmlElement(ElementName = "project_id", IsNullable = true)]
        public NullableInt ProjectId { get; set; }

        /// <summary>
        /// 
        /// </summary>
        [XmlElement(ElementName = "project")]
        public string Project { get; set; }

        /// <summary>
        /// 
        /// </summary>
        [XmlElement(ElementName = "task_id", IsNullable = true)]
        public NullableInt TaskId { get; set; }

        /// <summary>
        /// 
        /// </summary>
        [XmlElement(ElementName = "task")]
        public string Task { get; set; }

        /// <summary>
        /// 
        /// </summary>
        [XmlElement(ElementName = "hours", IsNullable = true)]
        public NullableDouble Hours { get; set; }

        /// <summary>
        /// 
        /// </summary>
        [XmlElement(ElementName = "notes")]
        public string Notes { get; set; }

        /// <summary>
        /// 
        /// </summary>
        [XmlElement(ElementName = "timer_started_at", DataType = "dateTime", IsNullable = true)]
        public DateTime? TimerStartetAt { get; set; }

    }

}
